<template>
	<view style="height: 100%;">
		<div class='set'>
			<div>
				<div class='headimage'>
					<div>
						<image src="http://oss.cardplayd.com/cardplay/common/headPortrait/headPortrait3.png" alt="">
						</image>
					</div>
					<div>
						<div class="nickName">用户070087</div>
					</div>
				</div>
			</div>
		</div>
		<!-- 功能 -->
		<div class='item'>
			<div @click='gotoAddress'>
				<div>
					<div>收货地址</div>
				</div>
				<div>
					<u-icon name="arrow-right" size="40"></u-icon>
				</div>
			</div>
			<div @click='gotoOrderList("1")'>
				<div>
					<div>待发货</div>
				</div>
				<div>
					<u-icon name="arrow-right" size="40"></u-icon>
				</div>
			</div>
			<div @click='gotoOrderList("2")'>
				<div>
					<div>待收货</div>
				</div>
				<div>
					<u-icon name="arrow-right" size="40"></u-icon>
				</div>
			</div>
			<div @click='gotoOrderList("3")'>
				<div>
					<div>已完成</div>
				</div>
				<div>
					<u-icon name="arrow-right" size="40"></u-icon>
				</div>
			</div>
		</div>
		<u-toast ref="uToast" />
	</view>
</template>

<script>
	import {
		getUserInfo
	} from '@/common/index.js'
	export default {
		data() {
			return {
				userInfo: {

				},
				isLogin: false,
				userBalance: '',
				userIntegral: '',
				recyclingModelShow: false,
			}
		},
		onLoad() {

		},
		onShow() {

		},
		mounted() {
			this.getUserInfo1()
		},
		methods: {
			getUserInfo1() {
				uni.getStorage({
					key: 'userInfo',
					success: (res) => {
						this.isLogin = true
						// //console.log(res, 'res');
						this.userInfo = res.data
						if (this.isLogin) {
							// this.queryUserWallet()
							// getUserInfo().then((res) => {
							// 	this.userInfo = res.data
							// 	//console.log(res);
							// 	if (res.code == 200) {
							// 		uni.setStorage({
							// 			key: 'userInfo',
							// 			data: res.data,
							// 		})
							// 	} else if (res.code == 401 || res.code == 403) {
							// 		this.isLogin = false
							// 	}
							// })
						}
					},
					fail: (res) => {
						// //console.log('fail', res);
						this.isLogin = false
					}
				})
				// //console.log(userInfo,'userInfo');
			},
			judgeLogin() {
				this.$refs.uToast.show({
					title: '未登录，请登录',
					message: '未登录，请登录',
					icon: false,
					position: 'top',
				})
			},
			gotoAddress() {
				// if (!this.isLogin) {
				// 	this.judgeLogin()
				// 	return
				// }
				uni.navigateTo({
					url: '/pages/address/address'
				})
			},
			gotoOrderList(status){
				uni.navigateTo({
					url:'/pages/orderList/orderList?status='+status
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	.set {
		box-sizing: border-box;
		width: 686rpx;
		// height: 330rpx;
		border-radius: 16rpx;
		background-color: #fff;
		margin: 0 auto;
		margin-top: 20rpx;
		padding: 20rpx;
		display: flex;
		align-items: center;

		.headimage {
			display: flex;
			align-items: center;

			>div:nth-child(1) {
				margin-top: 11px;

				image {
					border-radius: 50%;
					overflow: hidden;
					width: 116rpx;
					height: 116rpx;
					margin-right: 20rpx;
				}
			}
		}
	}

	.item {
		width: 686rpx;
		border-radius: 16rpx;
		background: #fff;
		margin: 20rpx auto;

		>div {
			width: 626rpx;
			height: 92rpx;
			line-height: 92rpx;
			display: flex;
			justify-content: space-between;
			margin: 0 auto;
			border-bottom: 1px solid #F4F4F4;
			font-weight: 400;
			font-size: 28rpx;

			>div {
				display: flex;
			}
		}
	}
</style>